﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace AllNations
{
    public partial class FlashVideo : MakeItWeb.Framework.MakeItWebPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            string videoUrl = Request.QueryString.ToString();
            string baseUrl = string.Format("http://{0}{1}", Request.Url.Host, Request.Url.Port == 80 ? string.Empty : string.Format(":{0}", Request.Url.Port));
            int width = 558;
            int height = 355;

            Literal litPrivateVideo = new Literal()
            {
                Text = string.Format(@"<object classid=""clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"" codebase=""http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0"" width=""{2}"" height=""{3}"" id=""VideoPlayer"" align=""middle""> <param name=""allowScriptAccess"" value=""*"" /> <param name=""allowFullScreen"" value=""true"" /> <param name=""movie"" value=""/FLVPlayer.swf?video={0}{1}&autoplay=true"" /> <param name""quality"" value=""high"" /><param name=""bgcolor"" value=""#ffffff"" /> <embed src=""/FLVPlayer.swf?video={0}{1}&autoplay=true"" quality=""high"" bgcolor=""#000000"" width=""{2}"" height=""{3}"" name=""VideoPlayer"" align=""middle"" allowScriptAccess=""*"" allowFullScreen=""true"" type=""application/x-shockwave-flash"" pluginspage=""http://www.macromedia.com/go/getflashplayer"" /> </object>",
                        baseUrl, videoUrl, width, height)
            };

            pldFlashVideo.Controls.Clear();
            pldFlashVideo.Controls.Add(litPrivateVideo);
        }
    }
}